<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>管理首页 | 统信迁移工具</title>
    <link type="text/css" rel="stylesheet" href="static/css/admin/framework.css" />
	<link href="static/css/admin/style.css" rel="stylesheet" type="text/css" />
    <link type="text/css" rel="stylesheet" href="static/css/admin/main.css" />
    <link type="text/css" rel="stylesheet" href="static/css/admin/alert.css" />
</head>
<body>
<div class="page">
	<div class="container">
		<div class="pageHeader" >
			<div class="segment">
				<h3 class="ui dividing header">	
					<img src="static/images/logo.png" style="width: 120px; height: 50px;"/>				
  					<label style="padding-left:320px;font-size:28px;">统信服务器系统迁移软件</label>
				</h3>
			</div>				
		</div>
	<div class="pageHeader">
        <div class="segment">
            <h5 class="ui dividing  header">
  		        <i class="large rocket alternate icon"></i>
  		        <div class="content">1.支持的操作系统</div>
            </h5>
            <h5 style="padding-left:50px;">● CentOS 7</h5>
            <h5 style="padding-left:50px;">● CentOS 8</h5>
            <div id="os_id1"><img src="../static/images/login.gif" width="13" height="13" style="padding-left:35px;"/><label style="font-size:13px;font-family:”思源黑体”;font-weight:bold;">正在检测当前操作系统版本......</label></div>
            <div id="os_id2" style="display: none;"><img id="os_res" name="0" src="../static/images/u70.svg" width="13" height="13" style="padding-left:35px;"/><label id="os_info1" style="font-size:13px;font-family:”思源黑体”;font-weight:bold;">当前操作系统不支持</label></div>
            <div id="os_id3" style="display: none;"><img src="../static/images/u57.svg" width="13" height="13" style="padding-left:35px;"/><label id="os_info2" style="font-size:13px;font-family:”思源黑体”;font-weight:bold;">当前操作系统支持</label></div>
        </div>
    </div>
    <div class="pageHeader">
        <div class="segment">
            <h5 class="ui dividing  header">
  		        <i class="large rocket alternate icon"></i>
  		        <div class="content">2.在‘/var/cache’中至少有10GB的可用空间</div>
            </h5>
            <div id="storage_id1"><img src="../static/images/login.gif" width="13" height="13" style="padding-left:35px;"/><label style="font-size:13px;font-family:”思源黑体”;font-weight:bold;">正在检测/var/cache的可用空间......</label></div>
            <div id="storage_id2" style="display: none;"><img id="storage_res" name="0" src="../static/images/u70.svg" width="13" height="13" style="padding-left:35px;"/><label id="storage_info1" style="font-size:13px;font-family:”思源黑体”;font-weight:bold;">可用空间为3GB</label></div>
            <div id="storage_id3" style="display: none;"><img src="../static/images/u57.svg" width="13" height="13" style="padding-left:35px;"/><label id="storage_info2" style="font-size:13px;font-family:”思源黑体”;font-weight:bold;">可用空间为10GB</label></div>
        </div>
    </div>
    </br>
    </br>
    </br>
    <div class="menter_btn_a_lf" >
        <hr style="opacity: 0.1;border: 1px solid #4C4D4E;width:99%;" />
        </br>
        </br>
        <button onclick="close_tool();" data-toggle="modal" data-target="#exampleModal" type="submit" class="menter_btn_a_a_lf" data-locale="Exit" style="text-align: center; line-height: 37px; color:black; font-size:18px;"><style>a{TEXT-DECORATION:none}</style>取消</button>
        <button id="check_id" onclick="save()" type="submit" class="menter_btn_a_a_lf" name="" style="text-align: center; line-height: 37px; color:black; font-size:18px;opacity: 0.2;" disabled = "disabled"><style>a{TEXT-DECORATION:none}</style>下一步</button>
    </div>
    </div>
</div>
<script type="text/javascript" src="static/js/admin/jquery.min.js"></script>
<script type="text/javascript" src="static/js/admin/framework.js"></script>
<script type="text/javascript" src="static/js/admin/jquery.zclip.min.js"></script>
<script type="text/javascript" src="static/js/admin/alert.js"></script>
<script type="text/javascript" src="static/js/admin/bootstrap.min.js"></script>
<script type="text/javascript" src="static/js/admin/json.js"></script>
<script>
    $(document).ready(function() {
        var check_os_data_json={"mod":"check_os"};
        check_os_data_json.ip="tasks"
        $.ajax({
            async:true,
            type: 'post',
            dataType: 'json',
            url: 'MT_check_os',
            data: $.toJSON(check_os_data_json),
            success: function(res) {
                res=$.evalJSON(res);
                if (res.ret == 1) {
                    document.getElementById('os_id1').style.display = "none"
                    document.getElementById('os_id2').style.display = ""
                    document.getElementById('os_info1').innerHTML=res.error
                }else if(res.ret == 0) {
                    document.getElementById('os_id1').style.display = "none"
                    document.getElementById('os_id3').style.display = ""
                    document.getElementById('os_info2').innerHTML=res.data
                    document.getElementById('os_res').name = '1'
                    check_node();
                }
            }
        });    
    });

    $(document).ready(function() {
        var check_storage_data_json={"mod":"check_storage"};
        check_storage_data_json.ip="tasks"
        $.ajax({
            async:true,
            type: 'post',
            dataType: 'json',
            url: 'MT_check_storage',
            data: $.toJSON(check_storage_data_json),
            success: function(res) {
                res=$.evalJSON(res);
                if (res.ret == 1) {
                    document.getElementById('storage_id1').style.display = "none"
                    document.getElementById('storage_id2').style.display = ""
                    document.getElementById('storage_info1').innerHTML=res.error
                }else if(res.ret == 0) {
                    document.getElementById('storage_id1').style.display = "none"
                    document.getElementById('storage_id3').style.display = ""
                    document.getElementById('storage_info2').innerHTML=res.data
                    document.getElementById('storage_res').name = '1'
                    check_node();
                }
            }
        });	
    });

    function check_node() {
        var os_res = document.getElementById('os_res').name;
        var storage_res = document.getElementById('storage_res').name;
        if (os_res == '1' && storage_res == '1') {
            document.getElementById('check_id').style.opacity = "1"
            document.getElementById('check_id').removeAttribute("disabled");
            os_res.name = '0';
            storage_res.name = '0';
        }
    }

    function save() {
        window.location.href="MT_check_user"
    }

	function close_tool() {
        alert("确定关闭迁移软件吗?");
	}
</script>
</body>
</html>
